{% extends "events/base.html" %}
{% load i18n %

{% block extrastyle %}{{ block.super }}<link rel="stylesheet" type="text/css" href="{% load adminmedia %}{% admin_media_prefix %}css/dashboard.css" />{% endblock %}

{% block coltype %}colMS{% endblock %}

{% block bodyclass %}dashboard{% endblock %}

{% block breadcrumbs %}
	{% if not is_popup %}
		<div class="breadcrumbs">
		     <a href="/">Home</a> &rsaquo;
		     <a href="/accounts/profile/">User Profile</a> &rsaquo;
		     {{ user.username }}
		</div>
	{% endif %}
{% endblock %}

{% block content %}

<form method="POST" action="">
	{% csrf_token %}
	<fieldset class="module aligned {{ fieldset.classes }}">
			<div class="form-row">
				<label for="id_username">Username</label>
				<p>{{ user.username }}</p>
			</div>
			<div class="form-row">
				<label for="id_password">Password</label>
				<p><a href="/accounts/password_change/">Change password</a></p>
			</div>
			
	        {% for field in form %}
	        <div class="form-row{% if field.errors %} errors{% endif %} {{ field.field.name }}">
	            {{ field.errors }}
	               {% if field.is_checkbox %}
	                   {{ field.field }}{{ field.label_tag }}
	               {% else %}
	                   {{ field.label_tag }}
	                   {% if field.is_readonly %}
	                       <p>{{ field.contents }}</p>
	                   {% else %}
	                       {{ field }}
	                   {% endif %}
	               {% endif %}
	               {% if field.help_text %}
	                   <p class="help">{{ field.help_text|safe }}</p>
	               {% endif %}
	        </div>
	    {% endfor %}
			<div class="form-row">
				<label for="id_active">Active</label>
				<p>{{ user.is_active }}</p>
			</div>
			<div class="form-row">
				<label for="id_last">Last Logon</label>
				<p>{{ user.last_login }}</p>
			</div>
			<div class="form-row">
				<label for="id_groups">Groups</label>
					<ul>
						{% for group in user.groups.all %}
							<li>{{ group.name }}</li>
						{% empty %}
							<li>No Groups</li>
						{% endfor %}
					</ul>
			</div>
	</fieldset>
	 <div class="submit-row">
 			<input type="submit" value="Update" class="default" name="_save" {{ onclick_attrib }}/>
 			<label>&nbsp;</label><input type="button" value="Cancel" ONCLICK="window.location.href='{% url ocms.main.views.index %}'"/>
	</div>
</form>
{% endblock %}

{% block sidebar %}
<div id="content-related">
    <div class="module" id="links-module">
		<h2> Links </h2>
			<ul>
				<li><a href = "/"> OCMS Home </a></li>
				<li><a href = "/events/"> Event Manager </a></li>
				<br>
				<li><a href = "./accounts/logout/"> Logout </a></li>
			</ul>
    </div>
</div>
{% endblock %}
